/*
 * masterPutCycleHost.h
 *
 *  Created on: 25/nov/2009
 *      Author: Aleph3
 */

#ifndef MASTERPUTCYCLEHOST_H_
#define MASTERPUTCYCLEHOST_H_
#include "masterCycle.h"
#include "utilities.h"
//segnali
#define ON_NOTIFY_MASTER_ACK_PACKET_P 5
#define ON_NOTIFY_MASTER_ACK_PACKET 6
#define ON_NOTIFY_MASTER_FAIL 7
extern Event masterPutCycleHostInitEvent;
//Notificatori
void NotifyMasterCycleHostPutAckPacketP(void* target);
void NotifyMasterCycleHostPutAckPacket(void* target);
void NotifyMasterCycleHostFail(void* target);
//Stati
StateOutcome masterPutCycleHostInitTransactionState (void* me,const Event* e);
StateOutcome masterPutCycleHostPacketSendingState (void* me,const Event* e);
StateOutcome masterPutCycleHostEndTransactionState (void* me,const Event* e);
StateOutcome masterPutCycleHostFinishFailState (void* me,const Event* e);
//transizioni
void fromPacketSendingStateToPacketSendingState(void* me);
void fromInitStateToPacketSendingState(void* me);
//Inizializzatore Trasmissione
void masterPutCycleHostInit(void* me,void* canPort, uint32_t msgId, uint8_t msgPayloadSize, uint8_t* msgPayload, uint32_t msgAnswer, Notifier onOk);
//tipo supporto evento init
typedef struct{
	uint16_t pPacket;
	void* contentBuffer;
} initData;
#endif /* MASTERPUTCYCLEHOST_H_ */
